package day04;

import java.util.Scanner;

public class ExExercise {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        if (num>0){
            System.out.println("+");
        } else if (num==0) {
            System.out.println("0");
        }
        else {
            System.out.println("-");
        }

        int year = sc.nextInt();
        int month = sc.nextInt();
        int h=0;

        if (year%4==0&&year%100!=0||year%400==0&&month==2){
            System.out.println("29天");
        }
        else if (month==2)
            System.out.println("28天");
        if (month!=2)
        if (month<8&&month%2==1||month>=8&&month%2==0){
                System.out.println("31天");
            }
        else {
                System.out.println("30天");
            }
            int first =sc.nextInt();
            int last  = sc.nextInt();
            int i,z;
            for ( i=first;i<=last;i++) {
                if (h%10==0&&h>0) {
                    System.out.println();
                }
                z=LeapYear(i);
                if (z!=0) {
                    System.out.print(z + "年 ");
                    h++;
                }
            }

    }
    public static int LeapYear(int first){
        if (first%4==0&&first%100!=0||first%400==0){
            return first;
        }
        else
            return 0;

    }

}
